﻿using Domain.Infrastructure;
using Ubiquity.Core.Web;

namespace Ubiquity.Web
{
    /// <summary>
    /// 分页 帮助类
    /// </summary>
    public static class PaginationHelper
    {
        /// <summary>
        /// 转换
        /// </summary>
        /// <param name="pagination"></param>
        /// <returns></returns>
        public static Pagination Change(this WebPagination pagination)
        {
            var paging = new Pagination()
            {
                Rows = pagination.rows,
                Page = pagination.page - 1,
                Records = pagination.records,
                //Sort = pagination.sord,
                //Order = pagination.sidx,
                Order = pagination.sord,
                Sort = pagination.sidx,
            };
            return paging;

        }
    }
}
